import { onScopeDispose } from 'vue'
import bus from '@/libs/bus'

const setTabActiveEventName = 'set-edit-left-tab-active'

// 发送修改选中标签事件
export const emitSetTabActiveEvent = data => {
    bus.emit(setTabActiveEventName, data)
}

// 接收修改选中标签事件
export const onSetTabActiveEvent = callback => {
    bus.on(setTabActiveEventName, callback)
    
    onScopeDispose(() => {
        bus.off(setTabActiveEventName, callback)
    })
}
